<?php
class Zendvn_Plugin_Error extends Zend_Controller_Plugin_Abstract{
	
	public function routeStartup(){ 
        $frontController = Zend_Controller_Front::getInstance();
       
        // Ensure this plugin is the only one (hackish, because FC does not allow custom ER setting)
        if ($frontController->hasPlugin('Zend_Controller_Plugin_ErrorHandler')) {
            $frontController->unregisterPlugin('Zend_Controller_Plugin_ErrorHandler');
        }
    }
    public function routeShutdown(Zend_Controller_Request_Abstract $request){
        $module = $request->getModuleName();
        if($module == 'admin')
        {
           $front = Zend_Controller_Front::getInstance();
           $front->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(array(
                 'module'     => 'admin',
                 'controller' => 'error',
                 'action'     => 'error'
           )));
        }
        if($module == 'default'){
        	
        }
    }
}